package chapter18;

import java.io.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2019-03-29 下午3:48
 */
public class Blips {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        System.out.println("constructing objects");
        Blip1 blip1 = new Blip1();
        Blip2 blip2 = new Blip2();
        ObjectOutputStream o = new ObjectOutputStream(new FileOutputStream("Blips.out"));
        System.out.println("saving objects");
        o.writeObject(blip1);
        o.writeObject(blip2);
        o.close();

        ObjectInputStream in = new ObjectInputStream(new FileInputStream("Blips.out"));
        System.out.println("recovering b1:");
        blip1 = (Blip1) in.readObject();
        System.out.println("recovering b2:");
//        blip2 = (Blip2) in.readObject();
    }
}
